package org.lanqiao.tjut.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.lanqiao.tjut.bean.TBStudentBean;
import org.lanqiao.tjut.model.ModelFactory;

import com.alibaba.fastjson.JSON;

/**
 * 学生信息跳转 StudentInfoModalModifyAjaxQuerySeverlet
 */
@WebServlet("/StudentInfoModalModifyAjaxQuerySeverlet")
public class StudentInfoModalModifyAjaxQuerySeverlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

	
	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// 获取参数
		String stuId=request.getParameter("sid");
		
		TBStudentBean stuB=ModelFactory.getStudentInfoModelInstance().getStudentInfoById(stuId);
		
		String json=JSON.toJSONStringWithDateFormat(stuB, "yyyy-MM-dd HH:mm:ss");
		System.out.println("ajax json:::"+json);
		
		PrintWriter pw=response.getWriter();
		
		pw.write(json);
		pw.flush();
		pw.close();
		
	}

}
